<template>
  <div class="box">
    <header class="header">
      <van-search v-model="value" show-action placeholder="搜索">
        <template #action>
          <div @click="onClickButton"></div>
        </template>
      </van-search>
    </header>
    <div class="content">
      <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="image in images" :key="image">
          <img style="width:100%;height:220px" :src="image" />
        </van-swipe-item>
      </van-swipe>
      <van-grid>
        <van-grid-item icon="photo-o" text="新品上市" />
        <van-grid-item icon="photo-o" text="热门产品" />
        <van-grid-item icon="photo-o" text="定制服务" />
        <van-grid-item icon="photo-o" text="平台信息" />
      </van-grid>
      <ProList></ProList>
    </div>
  </div>
</template>
<script setup>
import request from "@/utils/request";
import ProList from "./components/ProList.vue";
import { useCounterStore } from '@/stores/counter'
const store = useCounterStore()
const images = [
  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg",
  "https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg"
];
const list=ref([])
import { onMounted,ref } from "vue";
onMounted(() => {
  request.get("/list", {
    pagination: 1,
    pageNum: 40
  }).then((res) => {
    store.AddmyOrder(res.data.data)
  })
});
</script>